import request from '@/utils/request'
import { technicalApiUrl } from '../config'

/**
 * 施组方案审批列表
 * @param parameter
 */
export function getList(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/query',
    method: 'post',
    data: parameter
  })
}
/**
 * 施组方案审批列表统计
 * @param parameter
 */
export function getListTotal(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/total',
    method: 'get',
    params: parameter
  })
}

/**
 * 计划项下拉框新
 * @param parameter
 */
export function detailsQueryList(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-plan/detailsQueryList',
    method: 'post',
    data: parameter
  })
}
/**
 * 计划项下拉框
 * @param parameter
 */
export function getOption(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/option',
    method: 'get',
    params: parameter
  })
}

/**
 * 施组方案审批列表新增
 * @param parameter
 */
export function addList(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management',
    method: 'post',
    data: parameter
  })
}

/**
 * 施组方案审批列表编辑
 * @param parameter
 */
export function editList(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/update',
    method: 'post',
    data: parameter
  })
}

/**
 * 施组方案审批列表删除
 * @param parameter
 */
export function deleteList(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/del',
    method: 'post',
    params: parameter
  })
}

/**
 * 查询详情
 * @param parameter
 */
export function getDetails(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/details',
    method: 'get',
    params: parameter
  })
}
/**
 * 查询会签详情
 * @param parameter
 */
export function getSignDetails(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/details/basic_information',
    method: 'get',
    params: parameter
  })
}
/**
 * 提交会签
 */
export function putSign(data) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/implementation-plan/basic_information',
    method: 'post',
    data
  })
}
/**
 * 统计分组信息
 */
export function getGroupCount(data) {
  return request({
    url: technicalApiUrl + '/technical/approval-plan/implementation-plan/group-count',
    method: 'post',
    data
  })
}

/**
 * 统计信息
 */
export function getTotalCount(data) {
  return request({
    url: technicalApiUrl + '/technical/approval-plan/implementation-plan/count',
    method: 'post',
    data
  })
}

/**
 * 审批打印--施工组织设计（方案）编制评价表
 */
export function managementPrint(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-management/print',
    method: 'get',
    params: parameter
  })
}

/**
 * 审批打印--施工组织审批计划管理打印
 */
export function approvalDetailsPrint(parameter) {
  return request({
    url: technicalApiUrl + '/technical/approval-plan/details/print',
    method: 'get',
    params: parameter
  })
}

/**
 * 审批打印--打印一次报审表
 */
export function printAbyOne(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/printAbyOne/${data.id}`,
    method: 'get',
    data
  })
}

/**
 * 获取当前数据的历史数据列表
 */
export function getProgramHistoryList(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/getProgramHistoryList/${data.id}`,
    method: 'GET',
    data
  })
}

/**
 * 取当前数据的历史数据列表详情
 * @param parameter
 */
export function getConstructionProgramHistoryById(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/getConstructionProgramHistoryById/${data.id}`,
    method: 'get',
    data
  })
}

/**
 * 推优
 * @param parameter
 */
export function pushProgramGood(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/pushProgramGood`,
    method: 'POST',
    data
  })
}

/**
 * 新-施组方案审批确认
 * @param parameter
 */
export function createAuditApproval(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/createAuditApproval`,
    method: 'POST',
    data
  })
}

/**
 * 新-查询当前施组的审批节点
 * @param parameter
 */
export function getAuditApproval(parameter) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/getAuditApproval`,
    method: 'get',
    params: parameter
  })
}

/**
 * 新-回复查询（上报方案人_业务待办）
 * @param parameter
 */
export function getReplyAuditApproval(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/getReplyAuditApproval/${data.id}`,
    method: 'GET',
    data
  })
}

/**
 * 新-回复（上报方案人_业务待办）
 * @param parameter
 */
export function replyAuditApproval(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/replyAuditApproval`,
    method: 'POST',
    data
  })
}

/**
 * 新-获取施组方案审批详情-通过推优id
 * @param parameter
 */
export function getProgramByGoodId(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/program/getProgramByGoodId/${data.id}`,
    method: 'GET',
    data
  })
}

/**
 * 技术交底获取方案名称
 * @param parameter
 */
export function getProgramList(data) {
  return request({
    url: technicalApiUrl + `/technical/approval-management/getProgramList/${data.id}`,
    method: 'GET',
    data
  })
}




